<template>
	<view class="app">
		<!---->
		<view class="info">
			<view class="J-weixin-tip weixin-tip" style="display: block;">
				<view class="weixin-tip-content">
					请在菜单中选择在浏览器中打开,
				</view>
				<view class="weixin-tip-content">
					以完成支付
				</view>
			</view>
			
			<view class="tubiao">
					
				<view class="J-weixin-tip-img weixin-tip-img iphone"
				style="display: block;">
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		methods: {
			//判断是否在微信中  
			isWechat() {  
				var ua = window.navigator.userAgent.toLowerCase();  
				if (ua.match(/micromessenger/i) == 'micromessenger') {  
					//console.log('是微信客户端')    
					return true;  
				} else {  
					//console.log('不是微信客户端')    
					return false;  
				}  
			},
			getRequestParams() {
				let url = location.href;
				let requestParams = {};
				if (url.indexOf('?') !== -1) {
					let str = url.substr(url.indexOf('?') + 1); //截取?后面的内容作为字符串
					console.log(str, '?后面的内容');
					let strs = str.split('&'); //将字符串内容以&分隔为一个数组
					console.log(strs, '以&切割的数组');
					for (let i = 0; i < strs.length; i++) {
						requestParams[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
						// 将数组元素中'='左边的内容作为对象的属性名，'='右边的内容作为对象对应属性的属性值
					}
				}
				console.log(requestParams, '处理后的对象');
				return requestParams;
			}
		},
		onLoad() {
			// // #ifdef H5
			// let params = this.getRequestParams();
			// let salt = params['query'];
			// console.log(123,JSON.parse(salt))//111
			// // #endif
			
			if(!this.isWechat()){
				// uni.showToast({
				// 	icon: "none",
				// 	title: "不在微信"+this.$Route.query.info
				// })
				
				this.url = this.$Route.query.info
				window.location.href = this.url
			}
			console.log(this.url)
			
			
			// if(!this.isWechat()){
			// 	this.info = JSON.parse(this.$Route.query.info)
			// 	this.url = this.info.url
			// 	window.location.href = this.url
			// 	console.log(this.info)
			// }
			// console.log(this.info)
			// this.content = this.content.replace(/<p/g,'<p class="c_p"')
		}
	}
</script>

<style lang="scss">
	.app {
		height:100%
	}
	.weixin-tip{
		box-sizing: border-box;
		position: absolute;
		top: 60rpx;
		right: 40rpx;
		width: 560rpx;
		padding: 100rpx 0 0;
		text-align: left;
		background: url("~@/static/images/deposit/jiantou.png") no-repeat 100% 0;
		background-size: 80rpx 140rpx;
	}
	.weixin-tip-content {
	    font-size: 32rpx;
	    line-height: 40rpx;
		padding-right: 40px;
	}
	.tubiao{
		padding: 260rpx 0 0;
	}
	.weixin-tip-img{
		padding: 2.93333rem 0 0;
	}
	.iphone {
		width: 300rpx;
		height: 300rpx;
		background: url("~@/static/images/deposit/liulanqi.png");
		background-size: 100% 100%;
		    display: block;
		    margin: 20rpx auto;
		    content: " ";
		    background-size: cover;
	}
</style>
